package cn.ws.client;

import java.rmi.RemoteException;

import net.carefx.engine.core.ecm.components._Proxy63;
import org.apache.cxf.frontend.ClientProxyFactoryBean;
import org.apache.cxf.interceptor.LoggingInInterceptor;

public class HL7Client {
	
	public void requestWS(String message) throws RemoteException {
		ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
		factory.setServiceClass(_Proxy63.class);
		factory.setAddress("http://192.168.101.110:21102/services/HISHL7WS");
		factory.getInInterceptors().add(new LoggingInInterceptor());
		_Proxy63 service = (_Proxy63)factory.create();
//		service.acceptMessage("MSH|^~\\&amp;|HIS||EMR||201101050930||ADT^A01|MSG11O1O5OOO001|P|2.4||||||utf-8\r\n"+
//"PID||W8899103271421|||李明~Ming Li||19800302|M|||上海市黄兴路1号^121221^^^^^H~||^89568985|||M^已婚||||||^汉|湖南岳阳|||||^中国|||||||||||A|||||^教师|||||2014-07-31 10:04:28.000|||20141012221846\r\n"+
//"NK1||孙莉|SPO^配偶||^03678416234~^13545036854\r\n"+
//"PV1|1|P|10301000^10301301^25||||044777^张三~022554^李四|||||||1||||2|W810102402051|||||||||||||||||||||||||20140801||||||||||||1||||175^CM|46^KG|^李淼\r\n"+
//"DG1|001|I9|1550|肝脏或胰腺恶性肿瘤|20110510|A||||||||||002^王医生");
		service.acceptMessage(message);
	}
	public static void main(String [] agrs) throws RemoteException {
//		ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
//		factory.setServiceClass(_Proxy63.class);
//		factory.setAddress("http://192.168.103.113:21102/services/HISHL7WS");
//		factory.getInInterceptors().add(new LoggingInInterceptor());
//		_Proxy63 service = (_Proxy63)factory.create();
//		service.acceptMessage("MSH|^~\\&amp;|HIS||EMR||201101050930||ADT^A01|MSG11O1O5OOO001|P|2.4||||||utf-8\r\n"+
//"PID||W0899103271421|||李明~Ming Li||19800302|M|||上海市黄兴路1号^121221^^^^^H~||^89568985|||M^已婚||||||^汉|湖南岳阳|||||^中国|||||||||||A|||||^教师|||||2014-07-31 10:04:28.000|||20141012221846\r\n"+
//"NK1||孙莉|SPO^配偶||^03678416234~^13545036854\r\n"+
//"PV1|1|P|10301000^10301301^25||||044777^张三~022554^李四|||||||1||||2|W610102402051|||||||||||||||||||||||||20140801||||||||||||1||||175^CM|46^KG|^李淼\r\n"+
//"DG1|001|I9|1550|肝脏或胰腺恶性肿瘤|20110510|A||||||||||002^王医生");


	}

}
